package com.li.springbootproject.service.test.impl;

import java.util.Locale;

import com.li.springbootproject.service.test.MessageSourceTestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Service;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 2/21/2022 7:17 PM
 */
@Service
public class MessageSourceTestServiceImpl implements MessageSourceTestService {

    private static final Logger logger = LoggerFactory.getLogger(MessageSourceTestServiceImpl.class);

    @Autowired
    private MessageSource messageSource;

    @Override
    public void testOne() {
        String testOne = messageSource.getMessage("testone", null, Locale.CHINA);
        String str = String.format(testOne, "张三", "李四");
        logger.info(str);
    }
}
